import React from 'react'
import {useSearchParams,useLocation} from 'react-router-dom'

export default function Detail() {
  const [search,setSearch] = useSearchParams()
  // const a = useLocation()
  // console.log(a);
  return (
    <div>
      <h4>id:{search.get('id')}</h4>
      <h4>title:{search.get('title')}</h4>
      <h4>content:{search.get('content')}</h4>
      <button onClick={()=> {setSearch('id=8&title=哈哈&content=喜喜')}}>点我更新参数</button>
    </div>
  )
}
